﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ChiTietGioHang.ascx.cs" Inherits="UserControl_GioHang_ChiTietGioHang" %>
<%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %>
    
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
    <asp:View ID="View1" runat="server">
        <table bgcolor="Silver" border="0" cellspacing="0" width="100%">
            <tr>
                <td bgcolor="White" colspan="6">
                    <div ID="page-main-content-title" class="style1" style="outline: 0;">
            &nbsp;<asp:Label ID="Label3" runat="server" CssClass="title-item" 
                Text='Giỏ Hàng'></asp:Label>
        </div>
                    
                    </td>
            </tr>
            <tr>
                <td bgcolor="#CCCCCC" width="100px">
                    Mặt hàng</td>
                <td bgcolor="#CCCCCC">
                    Hình ảnh</td>
                <td bgcolor="#CCCCCC" width="100px">
                    Đơn giá</td>
                <td bgcolor="#CCCCCC" width="100px">
                    Số lượng</td>
                <td bgcolor="#CCCCCC" width="100px">
                    Thành tiền (vnd)</td>
                <td bgcolor="#CCCCCC" width="50px">
                    &nbsp;</td>
            </tr>
            <tr>
                <td bgcolor="White" colspan="6">
                    <asp:DataList ID="DataList1" runat="server" Width="100%" 
                        onitemcommand="DataList1_ItemCommand">
                        <ItemTemplate>
                            <table bgcolor="#CCCCCC" cellspacing="1" width="100%">
                                <tr>
                                    <td bgcolor="White" width="100px" valign="middle">
                                        &nbsp;&nbsp;
                                        <asp:LinkButton ID="LinkButton2" runat="server" 
                                            CommandArgument='<%# Eval("SanPhamID") %>' CommandName="MaSanPham" 
                                            Text='<%# Eval("SanPhamID") %>' 
                                            PostBackUrl='<%# "~/SanPham.aspx?ID="+Eval("SanPhamID") %>'></asp:LinkButton>
                                    </td>
                                    <td bgcolor="White">
                                        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%# Eval("HinhAnh") %>' 
                                            PostBackUrl='<%# "~/SanPham.aspx?ID="+Eval("SanPhamID") %>' Height="80px" 
                                            Width="80px" />
                                    </td>
                                    <td align="center" bgcolor="White" width="100px">
                                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("Gia","{0:N0}") %>'></asp:Label>
                                    </td>
                                    <td bgcolor="White" width="100px">
                                        <asp:TextBox ID="txtSoLuong" runat="server" EnableTheming="True" 
                                            Text='<%# Eval("SoLuong") %>' Width="98%"></asp:TextBox>
                                    </td>
                                    <td align="center" bgcolor="White" width="100px">
                                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("ThanhTien","{0:N0}") %>'></asp:Label>
                                    </td>
                                    <td align="center" bgcolor="White" width="50px">
                                        <asp:LinkButton ID="LinkButton1" runat="server" 
                                            CommandArgument='<%# Eval("SanPhamID") %>' CommandName="Xoa" 
                                            onclick="LinkButton1_Click">Xóa</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                ControlToValidate="txtSoLuong" ErrorMessage="Số lượng phải &gt;1 và &lt;10" 
                                MaximumValue="10" MinimumValue="1" Type="Integer"></asp:RangeValidator>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtSoLuong" 
                                ErrorMessage="Số lượng không được rỗng"></asp:RequiredFieldValidator>
                            <asp:HiddenField ID="BienAn" runat="server" />
                            <hr size="1" />
                        </ItemTemplate>
                    </asp:DataList>
                </td>
            </tr>
            <tr>
                <td bgcolor="#CCCCCC" colspan="4">
                    Tổng cộng</td>
                <td bgcolor="#CCCCCC">
                    <asp:Label ID="lblTongThanhTien" runat="server"></asp:Label>
                </td>
                <td bgcolor="#CCCCCC">
                </td>
            </tr>
            <tr>
                <td bgcolor="White" colspan="4">
                    &nbsp;</td>
                <td bgcolor="White">
                    &nbsp;</td>
                <td bgcolor="White">
                    &nbsp;</td>
            </tr>
            <tr>
                <td bgcolor="White" colspan="4">
                    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                        Text="Cập nhật giỏ hàng" />
                    &nbsp;&nbsp;
                    <asp:Button ID="Button2" runat="server" Text="Gửi đơn hàng" 
                        onclick="Button2_Click" />
                </td>
                <td bgcolor="White">
                    &nbsp;</td>
                <td bgcolor="White">
                    &nbsp;</td>
            </tr>
        </table>
    </asp:View>
    <asp:View ID="View2" runat="server">
        <table width="100%">
            <tr>
                <td colspan="3">
                <div ID="page-main-content-title" class="style1" style="outline: 0;">
            &nbsp;<asp:Label ID="Label1" runat="server" CssClass="title-item" 
                Text='THÔNG TIN KHÁCH HÀNG'></asp:Label>
        </div>
                    </td>
            </tr>
            <tr>
                <td width="150px">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="right">
                    Họ tên&nbsp; : </td>
                <td>
                    <asp:TextBox ID="txtHoten" runat="server" Width="100%"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtHoten" Display="None" ErrorMessage="Tên không được rỗng"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    Địa chỉ :</td>
                <td>
                    <asp:TextBox ID="txtDiachi" runat="server" Width="100%"></asp:TextBox>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="right">
                    Điện thoại&nbsp; :</td>
                <td>
                    <asp:TextBox ID="txtDienthoai" runat="server" Width="59%"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="txtHoten" Display="None" ErrorMessage="DT không được rỗng"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    Email :</td>
                <td>
                    <asp:TextBox ID="txtEmail" runat="server" Width="100%"></asp:TextBox>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="txtEmail" Display="None" ErrorMessage="Email không hợp lệ" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    Thông tin bổ sung :</td>
                <td width="300px">
                    <asp:TextBox ID="txtGhichu" runat="server" TextMode="MultiLine" Width="100%"></asp:TextBox>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="right">
                    &nbsp;</td>
                <td width="300px">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="right">
                    &nbsp;</td>
                <td width="300px">
                    <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="Gửi" 
                        Width="67px" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    </asp:View>
    <asp:View ID="View3" runat="server">
        <asp:Label ID="Label4" runat="server" Text="Gửi đơn hàng thành công!"></asp:Label>
        &nbsp;
    </asp:View>
</asp:MultiView>




